package com.share.tool.m2d.kundb.tablestructure;

import com.share.common.utils.FileUtil;

import java.util.List;

public class TableName {

    public static void main(String[] args) {
        String tabelStructFile = "E:\\share\\工作记录\\数据库\\表数据\\channel.sql";
        List<String> list = FileUtil.readByLine(tabelStructFile);
        for (String str : list) {
            String line = str.trim();

            if (line.startsWith("CREATE") && line.contains("TABLE")) {
                String tableName = line.replaceAll("CREATE", "").replaceAll("TABLE", "").replaceAll("IF", "").replaceAll("EXISTS", "").replaceAll(";", "").replaceAll("`", "").replaceAll("\\(", "").trim();
                System.out.println(tableName);
            }
        }
    }
}
